import java.util.Random;
import java.util.Scanner;

/**
 * Created by dllo on 18/4/2.
 */
public class Test骰子1 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        Random random = new Random();
        int money = 5000;
        while (money != 0)
        {
            int target1 = random.nextInt(6) + 1;
            int target2 = random.nextInt(6) + 1;
            int target3 = random.nextInt(6) + 1;
            int sum = target1 + target2 + target3;
            System.out.println("猜大小:" + 1 + ":大," + 2 + "小");
            int d = scanner.nextInt();
            switch (d) {
                case 1:
                    if (sum <= 10) {
                        System.out.println("你输了" + target1 + target2 + target3 + "小");
                        money = money - 5000;
                        System.out.println("剩余金钱为"+money);
                    } else {
                        System.out.println("你赢了" + target1 + target2 + target3 + "大");
                        money = money + 5000;
                        System.out.println("剩余金钱为"+money);
                    }
                    break;
                case 2:
                    if (sum > 10 && sum <= 18) {
                        System.out.println("你输了" + target1 + target2 + target3 + "大");
                        money = money - 5000;
                        System.out.println("剩余金钱为"+money);
                    } else {
                        System.out.println("你赢了" + target1 + target2 + target3 + "小");
                        money = money + 5000;
                        System.out.println("剩余金钱为"+money);
                        break;
                    }
            }
        }
        System.out.println("余额不足,请充值");
    }
}

